package com.mouse.magent.server.action;

import com.mouse.magent.common.protocol.Message;
import com.mouse.magent.common.service.BaseAction;
import com.mouse.magent.server.constant.ServerConstant;
import io.netty.channel.ChannelHandlerContext;

public class RemoteDisconnectAction extends BaseAction {
    @Override
    public void handle(ChannelHandlerContext ctx, Message message) throws Exception {
        ServerConstant.getRemoteChannelGroup().close(channel ->
                channel.id().asLongText().equals(message.getHeader().getChannelId()));
    }
}
